#include <iostream>
using namespace std;

class Solution {
public:
  int getHighestBit(int a) {
    while ((a & (a - 1)) != 0) {
      a = a & (a - 1);
    }
    return a;
  }
  int HigheqIndex(int a, int b) {
    int index = 0;
    int res = 0;
    for (int i = 31; i >= 0; --i) {
      index = 1 << i;
      if ((a & index) == (b & index)) {
        res = res | (a & index);
      } else {
        break;
      }
    }
    return res;
  }
  int rangeBitwiseAnd(int left, int right) { return HigheqIndex(left, right); }
};

int main() { cout << Solution().rangeBitwiseAnd(1, 1) << endl; }
